<?php

namespace catchAdmin\phone\controller;

use catchAdmin\phone\common\Jwt;
use EasyWeChat\Factory;


class Ce extends Jwt
{

    protected $appid = 'wx9716c94dd6591e8d';
    protected $appsecret = '92d08ea97d4a6e82dd86eda1c4a1504d';


    public function ce(){
        $config = [
            'app_id' => $this->appid,
            'secret' => $this->appsecret,

        ];

        $app = Factory::officialAccount($config);
         $result = $app->qrcode->temporary('foo', 6 * 24 * 3600);

        $url = $app->qrcode->url($result['ticket']);
        p($content = file_get_contents($url));
    }

}